import React from 'react';
import BgPng from './imgs/bg.png';
import { connect } from 'react-redux';
import _ from 'lodash';
import './index.less';

const Salve = props => {
  const mgmtIp = _.get(props, 'cert.mgmt_node_ip');
  return (
    <div className="slave">
      <div className="content">
        <img src={BgPng} />
        <p>
          该设备当前为集群工作模式，该设备为扫描节点，如需管理请跳转至管理节点
          <a href={`http://${mgmtIp}`} target="_self">
            {mgmtIp}
          </a>
          &nbsp;
        </p>
      </div>
    </div>
  );
};

const mapStateToProps = state => {
  return {
    cert: _.get(state, 'auth.cert', {})
  };
};

export default connect(
  mapStateToProps,
  null
)(Salve);
